@extends('admin.layouts.master')
@section('content')
    <link rel="stylesheet"
          href="{{asset('static/bootstrap/css/bootstrap.min.css')}}">
    <script type="text/javascript" charset="utf-8" src="{{url('utf8-php/ueditor.config.js')}}"></script>
    <script type="text/javascript" charset="utf-8" src="{{url('utf8-php/ueditor.all.min.js')}}"> </script>
    <script type="text/javascript" charset="utf-8" src="{{url('utf8-php/lang/zh-cn/zh-cn.js')}}"></script>
    <div class="col-md-12">
        <!-- 自定义内容区域 -->
        <div class="panel panel-default">
            <div class="panel-heading">添加轮播图片</div>
            <div class="panel-body">
                <form class="form-horizontal" enctype="multipart/form-data" action="{{url('admin/admin_carousel/store')}}"  method="post" >
                    {{csrf_field()}}
                    <div class="form-group">
                        <label class="col-sm-2 control-label">轮播图片的路径：</label>

                        <div class="col-sm-5">

                            <input type="file" name="imgpath">

                        </div>

                    </div>
                    <div class="form-group">
                        <label for="age" class="col-sm-2 control-label">图片解释：</label>
                        <div class="col-sm-5">
                            <input type="hidden" name="comment" id="contents" value="">
                            <div id="editor" type="text/plain" style="width:720px;height:300px;"></div>

                        </div>

                    </div>

                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" id="addpermission" class="btn btn-primary">提交</button>
                            <button type="submit" onclick="history.go(-1)" class="back btn btn-primary">返回</button>

                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!-- jQuery 文件 -->
    <script src="{{asset('static/jquery/jquery.min.js')}}"></script>
    <!-- Bootstrap JavaScript 文件 -->
    <script src="{{asset('static/bootstrap/js/bootstrap.min.js')}}"></script>
@endsection
@section('js')
    <script type="text/javascript">
        var ue = UE.getEditor('editor');
        function getContentTxt() {
            var arr = [];
            arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容");
            arr.push("编辑器的纯文本内容为：");
            arr.push(UE.getEditor('editor').getContentTxt());

        }
    </script>
    <script>
        $('.form-horizontal').submit( function () {
            var con = UE.getEditor('editor').getContent();
            var i = $('#contents').val(con);
        });
        alert(arr.join("\n"));
    </script>
@endsection
